package com.practice.car.cardataapp.schelduer.spark.scheduler;

import com.practice.car.cardataapp.schelduer.spark.analy.SaleRunner;

import java.util.ArrayList;
import java.util.List;

/**
 * car-data-app project
 *
 * @author ZhangMingXing
 * @date 2020/9/9
 */
public class SaleScheduler {
	private List<SaleRunner> analyerList = new ArrayList<>();


	public void schedule() {
		//初始化spark应用，根据需求进行数据的初始化缓存
		//分发所需的数据并执行分析任务
		analyerList.forEach(SaleRunner::run);
		//结束spark应用
	}
	public SaleScheduler add(SaleRunner runner) {
		analyerList.add(runner);
		return this;
	}
}
